'''
实效督察页面测试
'''
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage


class Actual(KeyWords):
    # 新增商户页面
    url = KeyWords.url + 'law-inspector/list'

    def list_by_source(self):
        '''
        根据督察来源筛选督察列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\list_by_source.yaml')
        element_operation(self, data[0]['data'])

    def list_by_type(self):
        '''
        根据督察类型筛选督察列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\list_by_type.yaml')
        element_operation(self, data[0]['data'])

    def list_by_status(self):
        '''
        根据督察状态筛选督察列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\list_by_status.yaml')
        element_operation(self, data[0]['data'])

    def list_by_time(self):
        '''
        根据督察状态筛选督察列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\list_by_time.yaml')
        element_operation(self, data[0]['data'])

    def search_by_people(self):
        '''
        根据督察人员搜索督察清单
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\search_by_people.yaml')
        element_operation(self, data[0]['data'])

    def search_by_department(self):
        '''
        根据责任部门搜索督察清单
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\search_by_department.yaml')
        element_operation(self, data[0]['data'])

    def search_by_number(self):
        '''
        根据督察单号搜索督察清单
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\search_by_number.yaml')
        element_operation(self, data[0]['data'])

    def stair_review(self):
        '''
        督察单一级审核
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\stair_review.yaml')
        element_operation(self, data[0]['data'])

    def second_review(self):
        '''
        督察单二级审核
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\second_review.yaml')
        element_operation(self, data[0]['data'])

    def send(self):
        '''
        下发督察单
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\send.yaml')
        element_operation(self, data[0]['data'])

    def detail(self):
        '''
        查看督察单详情
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\supervise\actual\detail.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    try:
        driver = choose_browser()
        L = LonginPage(driver)
        L.login('kobekq1', 'kobe8888')
        case = Actual(driver)
        case.detail()
        driver.quit()
    except Exception as E:
        print(E)
        driver.quit()
